set more off
log using ch5_logits.log, replace



****************
* Logit Models *
****************

use "C:\Users\sgolder\Dropbox\Projects\MEDW\ch5_turnout\New folder\ch5_replication_SG\chapter5.dta"


* Table 5.6-5.8: Regression models
* For saving the output
cd "C:\Users\sgolder\Dropbox\Projects\MEDW\ch5_turnout\New folder\ch5_replication_SG\"


*IDF
eststo clear 
logit Voted Female Age Education Interest Europe [pweight= DVWEIGHT] if REGIONID==201 
estadd scalar LL = e(ll)
eststo IDF1
 
logit Voted Female Age Education Interest Europe Attachment Impact Contact [pweight= DVWEIGHT] if REGIONID==201 
estadd scalar LL = e(ll)
eststo IDF2

logit Voted Female Age Education Interest Europe Attachment Impact Contact Importance [pweight= DVWEIGHT] if REGIONID==201 
estadd scalar LL = e(ll)
eststo IDF3

*Provence
logit Voted Female Age Education Interest Europe [pweight= DVWEIGHT] if REGIONID==202 
estadd scalar LL = e(ll)
eststo P1

logit Voted Female Age Education Interest Europe Attachment Impact Contact [pweight= DVWEIGHT] if REGIONID==202
estadd scalar LL = e(ll)
eststo P2

logit Voted Female Age Education Interest Europe Attachment Impact Contact Importance [pweight= DVWEIGHT] if REGIONID==202
estadd scalar LL = e(ll)
eststo P3


#delimit ;
esttab IDF1 IDF2 IDF3 P1 P2 P3  using results_Table5_6_France.rtf, b(%9.2f) se(%9.2f) 
title ("Table 5.6: Likelihood of Voting in French Elections")
label mtitles("Ile-de-France" "Ile-de-France" "Ile-de-France" "Provence" "Provence" "Provence") collabels("")
 rtf replace nonotes addnote("N = `e(N)'; Standard errors in parentheses. * p <
0.05; ** p < 0.01")  star(* 0.05 ** 0.01) 
stats(LL, fmt(%9.0f) ) 
varwidth(16)
order(Impact Attachment Contact Importance Interest Female Age Education Europe)
;
#delimit cr


*Bavaria
logit Voted Female Age Education Interest Europe Regional [pweight= DVWEIGHT] if REGIONID==402, cluster(RESPID)
estadd scalar LL = e(ll)
eststo B1

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact [pweight= DVWEIGHT] if REGIONID==402, cluster(RESPID)
estadd scalar LL = e(ll)
eststo B2

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact Importance [pweight= DVWEIGHT] if REGIONID==402, cluster(RESPID)
estadd scalar LL = e(ll)
eststo B3

*Lower Saxony
logit Voted Female Age Education Interest Europe Regional[pweight= DVWEIGHT] if REGIONID==401 
estadd scalar LL = e(ll)
eststo LS1

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact [pweight= DVWEIGHT] if REGIONID==401
estadd scalar LL = e(ll)
eststo LS2

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact Importance [pweight= DVWEIGHT] if REGIONID==401
estadd scalar LL = e(ll)
eststo LS3

#delimit ;
esttab B1 B2 B3 LS1 LS2 LS3  using results_Table5_7_Germany.rtf, b(%9.2f) se(%9.2f) 
title ("Table 5.7: Likelihood of Voting in German Elections")
label mtitles(" " "Bavaria" " " " " "Lower Saxony" " ")
 rtf replace nonotes addnote("N = `e(N)'; Standard errors in parentheses. * p <
0.05; ** p < 0.01")  star(* 0.05 ** 0.01) 
stats(LL, fmt(%9.0f) ) 
varwidth(16)
order(Impact Attachment Contact Importance Interest Female Age Education Europe)
;
#delimit cr


*Catalonia
logit Voted Female Age Education Interest Europe Regional [pweight= DVWEIGHT] if REGIONID==301 
estadd scalar LL = e(ll)
eststo C1

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact [pweight= DVWEIGHT] if REGIONID==301
estadd scalar LL = e(ll)
eststo C2

logit Voted Female Age Education Interest Europe Regional Attachment  Contact Impact Importance [pweight= DVWEIGHT] if REGIONID==301
estadd scalar LL = e(ll)
eststo C3

*Madrid 
logit Voted Female Age Education Interest Europe Regional [pweight= DVWEIGHT] if REGIONID==302 
estadd scalar LL = e(ll)
eststo M1

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact [pweight= DVWEIGHT] if REGIONID==302
estadd scalar LL = e(ll)
eststo M2

logit Voted Female Age Education Interest Europe Regional Attachment Contact Impact Importance [pweight= DVWEIGHT] if REGIONID==302
estadd scalar LL = e(ll)
eststo M3


#delimit ;
esttab C1 C2 C3 M1 M2 M3  using results_Table5_8_Spain.rtf, b(%9.2f) se(%9.2f) 
title ("Table 5.8: Likelihood of Voting in Spanish Elections")
label mtitles(" " "Catalonia" " " " " "Madrid" " ")
 rtf replace nonotes addnote("N = `e(N)'; Standard errors in parentheses. * p <
0.05; ** p < 0.01")  star(* 0.05 ** 0.01) 
stats(LL, fmt(%9.0f) ) 
varwidth(16)
order(Impact Attachment Contact Importance Interest Female Age Education Europe )
;
#delimit cr




log close
